#include <iostream>
#include <vector>
#include <bitset>
using namespace std;

class Main {
	using LL = long long;
	int n, k;
	vector<int> sit;
	vector<int> sat;
	vector<vector<vector<LL>>> dp;
	void pre()
	{
		for (int i = 0, s = i; i < (1 << n); i++, s = i) {
			if (s & (s >> 1)) {
				continue;
			}
			sit.push_back(s);

			int cnt = 0;
			while (s) {
				cnt += (s & 1);
				s >>= 1;
			}
			sat.push_back(cnt);
		}
	}

    public:
	Main(int nn, int kk) : n(nn), k(kk), dp(n + 2, vector<vector<LL>>(1 << n, vector<LL>(k + 1, 0)))
	{
		pre();
	}

	LL method()
	{
		dp[0][0][0] = 1;
		for (int i = 1; i <= n + 1; i++) {
			for (int s = 0, cs = sit[s]; s < sit.size(); s++, cs = sit[s]) {
				for (int p = 0, ps = sit[p]; p < sit.size(); p++, ps = sit[p]) {
					if ((cs & ps) || (cs & (ps >> 1)) || (cs & (ps << 1))) {
						continue;
					}
					for (int k = sat[s]; k <= Main::k; k++) {
						dp[i][cs][k] += dp[i - 1][ps][k - sat[s]];
					}
				}
			}
		}
		return dp[n + 1][0][Main::k];
	}

	LL method(int row, int ps, int k)
	{
		if (row == n) {
			return k == Main::k ? 1 : 0;
		}
		LL ans = 0;
		for (int i = 0, cs = sit[i]; i < sit.size(); i++, cs = sit[i]) {
			if ((cs & ps) || (cs & (ps >> 1)) || (cs & (ps << 1))) {
				continue;
			}
			if (k + sat[i] <= Main::k) {
				ans += method(row + 1, cs, k + sat[i]);
			}
		}
		return ans;
	}

	LL method_lu()
	{
		//vector<vector<vector<LL>>> dp(n + 1, vector<vector<LL>>(1 << n, vector<LL>(Main::k + 1, 0)));
		for (int i = 0; i < sit.size(); i++) {
			dp[n][sit[i]][k] = 1;
		}

		for (int i = n - 1; i >= 0; i--) {
			for (int s = 0, cs = sit[s]; s < sit.size(); s++, cs = sit[s]) {
				for (int p = 0, ps = sit[p]; p < sit.size(); p++, ps = sit[p]) {
					if ((cs & ps) || (cs & (ps >> 1)) || (cs & (ps << 1))) {
						continue;
					}
					for (int k = 0; k <= Main::k; k++) {
						if (k + sat[s] <= Main::k) {
							dp[i][ps][k] += dp[i + 1][cs][k + sat[s]];
						}
					}
				}
			}
		}
		return dp[0][0][0];
	}
};

int main()
{
	int n, k;
	cin >> n >> k;
	Main app(n, k);
	//cout << app.method() << endl;
	//cout << app.method(0, 0, 0) << endl;
	cout << app.method_lu() << endl;
	return 0;
}